package cn.tedu.micro.demo.order.controller;

import cn.tedu.micro.demo.common.pojo.protocol.JsonResult;
import cn.tedu.micro.demo.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;

    @PostMapping("/order/create")
    public JsonResult<String> createOrder(Integer gunId,Integer userId){
        String billId=orderService.createOrder(gunId,userId);
        return JsonResult.ok("订单创建成功",billId);
    }
}
